package selenium;

import org.openqa.selenium.By;
import org.openqa.selenium.chrome.ChromeDriver;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: lucky
 * Date: 2022-11-11
 * Time: 11:36
 */
public class fristaototest {
        public void dilireba_test() throws InterruptedException {
            //1.创建一个驱动对象来打开浏览器
            ChromeDriver driver = new ChromeDriver();
            Thread.sleep(3000);
            //2.输入百度网址
            driver.get("https://www.baidu.com");
            Thread.sleep(3000);
            //3.找到百度输入框，输入关键字“赵丽颖”
            driver.findElement(By.cssSelector("#kw")).sendKeys("赵丽颖");
            Thread.sleep(3000);
            //4.找到百度一下的按钮，并点击
            driver.findElement(By.cssSelector("#su")).click();
            Thread.sleep(3000);
            //5.释放驱动资源，关闭浏览器
            driver.quit();
        }
}
